<?php
header("Content-type: text/html; charset=gbk");
$str=file_get_contents('http://www.zuowen.com/e/20160127/56a857dca3549.shtml');
$mat="/<div class=\"con_content\">(.*?)<\/div>/s";
$c=preg_match_all($mat,$str,$res);
//var_dump($c);
//var_dump($res);
$x=strip_tags($res[1][0]);
//file_put_contents('./demo.txt',$x);

$filename="./demo.txt";

$handle=fopen($filename,"a+");

$str=fwrite($handle,$x);

fclose($handle)





















?>